from fastapi import APIRouter
from fastapi import Request
from fastapi.responses import HTMLResponse
from fastapi.templating import Jinja2Templates

from conf import variable

templates = Jinja2Templates(directory="resources/templates")

router = APIRouter(prefix=variable.CONTEXT_PATH,
                   tags=['views'])


@router.get('/label.html', response_class=HTMLResponse)
async def label_html(request: Request):
    return templates.TemplateResponse("label.html", {"request": request})


@router.get('/reportlist.html', response_class=HTMLResponse)
async def reportlist_html(request: Request):
    return templates.TemplateResponse("reportlist.html", {"request": request})


@router.get('/main.html', response_class=HTMLResponse)
async def main_html(request: Request):
    return templates.TemplateResponse("main.html", {"request": request})


@router.get('/top.html', response_class=HTMLResponse)
async def top_html(request: Request):
    return templates.TemplateResponse("top.html", {"request": request})


@router.get('/left.html', response_class=HTMLResponse)
async def left_html(request: Request):
    return templates.TemplateResponse("left.html", {"request": request})


@router.get('/dcmlist.html', response_class=HTMLResponse)
async def datalist_html(request: Request):
    return templates.TemplateResponse("dcmlist.html", {"request": request})


@router.get('/', response_class=HTMLResponse)
async def index_html(request: Request):
    return templates.TemplateResponse("index.html", {"request": request})
